package operation;
import book.Book;
import book.Booklist;

import java.util.Scanner;

public class Add implements IOoperation {
    public void work(Booklist book) {
        System.out.println("新增图书！");
        int cnt=book.getCount();
       Scanner sc=new Scanner(System.in);
        System.out.println("名字");
       String name=sc.nextLine();
        System.out.println("作者");
       String author=sc.nextLine();
        System.out.println("价格");
       int price=sc.nextInt();
       sc.nextLine();
        System.out.println("类型");
       String type=sc.nextLine();
       Book book1=new Book(name,author,price,type);
        book.getSize(cnt+1);
       book.addBook(book1,cnt);
        System.out.println("添加成功！");
    }
}
